package com.hnucm.eatwhat_java.adapter;

import android.view.LayoutInflater;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.DraggableModule;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hnucm.eatwhat_java.R;
import com.hnucm.eatwhat_java.databinding.ShopItemBinding;
import com.hnucm.eatwhat_java.pojo.Shop;

import java.util.List;

public class BravhShopAdapter extends BaseQuickAdapter<Shop, BaseViewHolder> implements DraggableModule, LoadMoreModule {

    public BravhShopAdapter() {
        super(R.layout.shop_item);
    }

    public BravhShopAdapter(int layoutResId) {
        super(layoutResId);
    }

    public BravhShopAdapter(int layoutResId, @Nullable List<Shop> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, Shop shop) {
        ShopItemBinding binding=holder.getBinding();
        if(binding!=null){
            binding.setItem(shop);
            binding.executePendingBindings();
        }
    }
}
